package com.hospital.workstation.controller;

import com.hospital.common.core.controller.BaseController;
import com.hospital.common.core.domain.R;
import com.hospital.workstation.domain.HisExtendOneInfo;
import com.hospital.workstation.domain.vo.HisExtendOneInfoVo;
import com.hospital.workstation.service.IHisExtendOneInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * HIS续一信息
 *
 * @author whb
 * @date 2024-05-28
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/workstation/extendOneInfo")
public class HisExtendOneInfoController extends BaseController {

    private final IHisExtendOneInfoService iHisExtendOneInfoService;

    /**
     * 根据药历号查询续一信息
     *
     * @param medicalRecordNo 药历号
     * @return
     */
    @GetMapping("/list/{medicalRecordNo}")
    public R<List<HisExtendOneInfoVo>> getHisExtendOneInfoList(@NotNull(message = "药历号不能为空")
                                                               @PathVariable Integer medicalRecordNo) {
        return iHisExtendOneInfoService.getHisExtendOneInfoList(medicalRecordNo);
    }
}
